home *** CD-ROM | disk | FTP | other *** search
/ Aminet 31 / Aminet 31 (1999)(Schatztruhe)[!][Jun 1999].iso / Aminet / comm / tcp / GetAllHTML.lha / GetAllHTML.doc < prev    next >
Encoding:
Text File  |  1999-04-04  |  15.4 KB  |  330 lines

  1. GetAllHTML v0.64ß  Copyright 1998 Christoper S Handley
  2. ======================================================
  3. Latest News
  4. -----------
  5. A fix I did in v0.61 was actually wrong - undone so that all downloading should
  6. work properly now.  Also improved BROKENLINKS & other minor things.  I actually
  7. had time to test this release, so it should work pretty well! :-)
  8.  
  9. Many people have been having problems with GetAllHTML after editing it - seems
  10. this is due to spurious ASCII-27 characters mucking-up some editors :-( .
  11. Anyway, I wrote a program to detect & remove all non-visible characters
  12. (available if wanted), and it seems that GetAllHTML is the only recent text file
  13. I wrote which had the problem...  Any ideas WHY they appeared?  I use CygnusEd
  14. v3.5.
  15.  
  16. I've programmed the BROKENLINKS switch to allow web page makers to automagically
  17. search their site for broken links - written just for Alexander Niven-Jenkins
  18. (emailing me can be worth it;-)
  19.  
  20. Changed the NOPAUSE switch to PAUSE, so that it defaults to NOT pausing.
  21.  
  22. Very minor enhancments & fixed an arguments interpreting bug.
  23.  
  24. I will still fix major bugs until I have an AmigaE version that can be tested.
  25.  
  26. Introduction
  27. ------------
  28. Have you ever visited a cool web site & wanted to keep a copy of some/all of it,
  29. but it would takes ages to find & download all the respective pages/files?
  30.  
  31. This is the answer!
  32.  
  33. You supply this ARexx script with the start page URL, and a destination
  34. directory (which should be empty), and maybe a few other options - and off it
  35. goes!  Note that it needs HTTPResume v1.3+ to work (get from Aminet).
  36.  
  37. The idea for this came from a PC Java program called PageSucker - sadly it is
  38. over 1Mb in size & buggy (& can't be run on the Amiga, yet!).  Although my
  39. implementation may not have quite as many features, it is does do the job quite
  40. fast, & has fairly low memory overheads.
  41.  
  42. Requirements
  43. ------------
  44.  o HTTPResume v1.3+
  45.  
  46.  o An Amiga capable of running ARexx programs
  47.  
  48.  o Libs:Rexxsupport.library
  49.  
  50.  o Modem with TCP/IP stack (like Genesis, Miami, or AmiTCP)
  51.  
  52. Usage
  53. -----
  54. 1.Before running it for the first time you must (text) edit (say using C:ED) it
  55. to know where your copy of HTTPResume is located.  Go to line 19 where it says:
  56.     HTTPResume='Programs:Utils/Comms/HTTPResume'
  57. Alter the file path between the 'quotes' to where you keep HTTPResume, and save.
  58.  
  59. 2.Run your TCP/IP stack (e.g.AmiTCP/Genesis or Miami).
  60.  
  61. 3.Run it from a Shell using:
  62.  
  63.     Sys:RexxC/Rx GetAllHTML arguments
  64.  
  65. Where the arguments are:
  66.  
  67. "URL"/A, "DestDir"/A, NOASK/S, ARC/S, PIC/S, RESUME/S, PAUSE/S, DEPTH=/N/K, PORT=/K,
  68. BASEURL=/K, BROKELINKS/S
  69.  
  70. Note - The destination dir must be empty of any previous attempt at downloading
  71. that web page (unless using the RESUME switch).  And that both URL & DestDir
  72. *must* be enclosed in "double quotes" - and that the BASEURL must NOT be
  73. surrounded by quotes!
  74.  
  75. *Note* you may have several GetAllHTMLs & HTTPResumes running at the same time
  76. (not on the same URL!), and that if you use the PORT argument then you will need
  77. HTTPResume running first.
  78.  
  79. See the file GetAllHTML_ex.script for an example usage - it will download all of
  80. Squid's on-line artwork (hope he gets a few more sales of his wonderful 'other 
  81. world' artwork from this :-).
  82.  
  83. Behaviour
  84. ---------
  85. It's default behaviour is to find all links in each HTML page, and download them
  86. if:
  87.  
  88. -the URL path is a sub-directory of the original URL path; this stops
  89. downloading irrelevant pages on different topics, different servers, etc.., AND
  90.  
  91. -if they are HTML pages (name ends in .html, etc), OR
  92.  
  93. -if not HTML pages then it will ask if the file should be downloaded; if answer
  94. does not begin with an "n" then it does (download).  If the file has the same
  95. suffix as the last positively confirmed download, then intelligently assumes
  96. should download...
  97.  
  98. This behaviour is modified by various switches:
  99.  
  100. RESUME    - Should downloading of pages have been interupted (maybe a crash), run
  101.     GetAllHTML with *exactly* the same options, except with this switch too.
  102.     It will take a while to reach the same place as all previous HTML pages
  103.     must be scanned - and some additional memory usage is incured.
  104.  
  105.      I suggest you don't go on-line until it has reached the previously
  106.     interupted point (it wait for you to press return).
  107.  
  108.     *NOTE* that this mode is flawed due to the way GetAllHTML.rexx works,
  109.     so that it will sometimes think it has reached the previously finished
  110.     point, when it has not in fact.  Still RESUME is very useful!  And an
  111.     AmigaE version would fix this.
  112.  
  113. PIC    - Will identify links to pictures & download them rather than ask.
  114.  
  115. ARC    - Will identify links to archives & download them rather than ask.
  116.  
  117. NOASK    - Do not ask user if should download a file, assume should not.
  118.  
  119. PAUSE   - DO ask user to "press <return>" if we get an empty URL or couldn't
  120.     download a file.  Always asked to by the RESUME function.
  121.  
  122. TERSE    - Only outputs very important text, so it won't report strange URLs,
  123.     failure to download files, non-http links, etc...
  124.  
  125. PORT    - Supplies the ARexx port of a *running* HTTPResume; if supplied then
  126.     does not try to launch HTTPResume from AmigaDOS.  See *Note* below.  If
  127.     no port name is supplied then it sees if the current ARexx port is
  128.     already set to some HTTPResume - if not then an error is generated, else
  129.     it just uses that port.
  130.  
  131. DEPTH    - This allows you to specify how many URL links to follow in sequence;
  132.     i.e.the depth of the search.  DEPTH=1 means download only the links from
  133.     the original page, and so on for DEPTH=2, etc..  See *Note* below.  If
  134.     no number is supplied then the user is asked for a number.
  135.  
  136. BASEURL - This allows you to override the semi-intelligent default, and tell
  137.     GetAllHTML the base URL - that is, what the URL must start with for it
  138.     to even consider downloading it.  This is useful if you wish to download
  139.     from a particular page deep down the directory structure, but which
  140.     references images (or maybe pages) that are further up.
  141.  
  142. BROKENLINKS - This causes attempted downloading of pages that are not
  143.     sub-directories of the original URL.  These will be downloaded to "T:"
  144.     (which is usually "RAM:T") & then deleted.  If download failed then you
  145.     will be told that there was a broken link.  See suggested uses below.
  146.  
  147. *Note* that both DEPTH & PORT must be followed by an equals sign ("=") and then
  148. the data, _without_ any spaces between anything.  This is due to a limitation of
  149. ARexx, for which an AmigaE version would fix.
  150.  
  151. Suggested uses
  152. --------------
  153. 1.There's a big web site with lots of pictures/music/archives/information that
  154. interests you.  Depending on what you want, you will need to use the PIC, ARC,
  155. and NOASK switches.
  156.  
  157. For instance, if you are only interested in pictures then use PIC & NOASK.  If
  158. you are only interested in archives then use ARC & NOASK.  If you are interested
  159. in something else than pictures or archives (in addition to the web pages), then
  160. don't use any of those three switches - GetAllHTML will ask you if something
  161. should be downloaded.
  162.  
  163.  
  164. 2.You have your own home-page on the web, and it includes lots of links to other
  165. sites for which take hours to check they are all valid.  Point GetAllHTML at
  166. your web site with the BROKENLINKS switch.  Note will never try to download a
  167. link twice, even withOUT using RESUME.
  168.  
  169. In fact, if you have your web site in a directory on your HD, then you could
  170. RESUME with that directory as your download directory; this will be MUCH faster
  171. since none of your pages will (or should) be downloaded :-)) .  First time you
  172. try this, do it on a back-up copy to ensure GetAllHTML does not do anything
  173. strange (I won't be held responsible for extra files 'magically' appearing!)..
  174.  
  175. 3.If you have a favourite news page then you can use GetAllHTML to download just
  176. the latest news by using RESUME.  Suggest use NOASK, possibly with PIC if you
  177. want pictures too.  Cool eh?
  178.  
  179.  
  180. Any other ideas?
  181.  
  182. Bugs & other unwelcome features
  183. -------------------------------
  184.  o The RESUME feature could in theory cause some files to be missed, with a VERY
  185. unlikely combination of file and/or directory names - it was decided to do this
  186. to obtain a large speed-up over a full-proof method.  An AmigaE version would
  187. fix this.
  188.  
  189.  o Interpretation of the HTML & URLs is based on observation rather than any
  190. specification of these standards - thus there will probably be rare cases in
  191. which it may misinterpret them; as long as these are reported (along with the
  192. responsible HTML file(s)), fixes will probably be forth coming.
  193.  
  194.  o You cannot go above a depth of 42; this is to protect against an ARexx
  195. limitation which will cause problems above a depth of about 45.  An AmigaE
  196. version would fix this.
  197.  
  198. Technical info
  199. --------------
  200. GetAllHTML uses a depth-first tree search, via recursion, and uses the existance of
  201. (downloaded) files as a super-fast record of whether a page has been visited or
  202. not.
  203.  
  204. When RESUMEing, existance of files cannot be used to record if a page has been
  205. visited, so an alternate method is used - this is slower, and could fail with
  206. certain combinations of strangely named URLs (very unlikely); a far slower
  207. method would avoid this, but was considered unnecessary.
  208.  
  209. I used the INTERPRET command to do some magic with ARexx to make the arbitarily
  210. long linked-lists (really branches) possible - they were required for storing
  211. what pages have been visited.  Although this method is not very memory efficient
  212. (many duplicate entries of the same URL), it is quite fast - and more
  213. importantly it *works* in ARexx.  I had thought it would be virtually impossible
  214. to make arbitarily extended link-lists in ARexx, but the interpretive nature of
  215. ARexx means you can effectively create ARexx commands on-the-fly.
  216.  
  217. Future
  218. ------
  219. Little development of the *ARexx* version of GetAllHTML is likely - my efforts
  220. are now on the super-fast AmigaE version:  This will vastly speed-up RESUMEing,
  221. use far less memory & CPU usage, and may even give substantial speed-ups to
  222. normal operations as well (as the time between downloading files will be reduced
  223. to almost nothing).  I hope it will eventually support multiple downloads at
  224. once, to minimise the total download time.
  225.  
  226. For those interested (& as an advert!), since finishing v0.51ß I have been
  227. working on 2 (Object Orientated) modules for AmigaE which will make writing a
  228. conversion of GetAllHTML very easy:  ARexxComm (for stupidly easy ARexx
  229. communication), and CString ('crashless' & very easy string handling - E's
  230. built-in string functions make string VERY much harder than in say ARexx or 
  231. Basic).
  232.  
  233. ARexxComm is fully working, and is on the Aminet.  CString is NOT yet finished,
  234. but I it may be soon - may get an Aminet release too.
  235.  
  236. As a side note, once CString is finished, I will start work on the E version of
  237. GetAllHTML - BUT, I also have 2 pet projects that will use up much of my
  238. programming time too...  Emails prompting me to write GetAllHTML may get it
  239. written a bit quicker ^_^ though a 32Mb SIMM would do wonders ;-)
  240.  
  241. BTW, I could release my first AmigaE program - a simple DIF program; there was
  242. no fast DIF program that was suited to AmigaDOS scripts (so I wrote it:).
  243.  
  244. About the Author
  245. ----------------
  246. My name is Christopher S Handley, aged 21, my (permanent) email address is
  247. Chris.S.Handley@BTInternet.com.  I have got a 2.1 BEng(Hons) in Electronic
  248. Engineering (specialising in digital system & chip design) after 3 years at
  249. Sheffield University, and am currently doing a 1 year MSc in the same area.  I'm
  250. also looking for possible jobs - doubt I'll get any offers cos of GetAllHTML
  251. though!
  252.  
  253. In no particular order my interests include Science Fiction (mostly hard SF
  254. books, esp.robot stories), Japanese Anime (ones with believable characters &
  255. decent plots, or at least very funny, and definitely *not* the violent "Manga"
  256. type of Anime videos), the Amiga since Xmas 1990 (even after using Macs & PCs a
  257. lot, I find it the nicest computer to use), programming (mostly in AmigaE,
  258. ARexx, AmigaDOS, and occasionally C & VHDL), music (I couldn't live without
  259. it!), generally thinking up crazy theories & cool algorithms, learning Japanese
  260. (slowly), cunning things you can do in digital design (esp.multi-processors
  261. ATM), reading 'true' Manga (Japanese comics), cross country running (not that
  262. I've done much lately), and thats probably enough for now!
  263.  
  264. Contacting the Author
  265. ---------------------
  266. Email: Chris.S.Handley@BTInternet.com
  267.  
  268. If I cannot be reached by that email address, in an emergency I may be reached
  269. at Chris.S.Handley@eva01.freeserve.co.uk but I usually only check this maybe
  270. once a month!
  271.  
  272. I am not yet sure about giving my snail mail address to all & sundry - sorry
  273. about that :-(I know how I felt when people did that before I had email access).
  274.  
  275. Thanks to
  276. ---------
  277.  o Andrija Antonijevic for HTTPResume
  278.  
  279.  o the Amiga community for sticking with the Amiga, and continuing to innovate.
  280.   Give your backing to KOSH (originally proposed by Fleecy Moss).
  281.  
  282.  o CU Amiga for becoming the greatest Amiga mag over the last year, before
  283.   passing away.  I did not like AF's Xmas issue at all (and AF didn't appear to
  284.   like my criticism of it either...)
  285.  
  286.  o whoever design the Rexx language - Rexx is great for 'user utilities'.
  287.  
  288. History
  289. -------
  290. v0.64ß (04-04-99) - Put back the 'extra' END that I removed in v0.61 .  Now
  291.             BROKENLINKS will always only try to download external links
  292.             once.  Removed NOENV argument of HTTPResume so proxy
  293.             settings may work.  Minor changes.
  294. v0.63ß (04-04-99) - Removed spurious non-visible ASCII (27) characters that
  295.            caused some text editors to go loopy.
  296. v0.62ß (03-04-99) - Add the BROKENLINKS switch.  Replaced NOPAUSE by PAUSE
  297.            switch.  Now always warns if a file could not be downloaded
  298.            (not just pages).  If you used all the arguments then it
  299.            would miss the last one.
  300. v0.61ß (28-03-99) - Possible fix for RESUME problem done, plus stupidly left an
  301.            extra END where it broke GetAllHTML.
  302. v0.60ß (27-03-99) - First stand-alone Aminet release.  Damn!  There were 3 big
  303.            mistakes...  (a)some files expected as directories,
  304.            (b)local-path expansion was too complex & probably wrong
  305.            (hope right now), (c)implicit InDeX.hTmL files were not
  306.            scanned for files.  Also asked user to press return but
  307.            really wanted a key first!
  308. v0.55ß (14-12-98) - Damn!  All this fast programming has introduced some bugs,
  309.            but they are fixed now; included the "~" interpretation was
  310.            completely wrong (removed), and fixed a long standing bug
  311.            where a URL beginning with a slash was mis-understood.  Also
  312.            added the BASEURL feature which is really useful sometimes.
  313. v0.54ß (12-12-98) - Given I couldn't download the KOSH pages (www.kosh.net), I
  314.            added basic frame support, and fixed a long standing bug
  315.                    where root html pages could appear as empty directories!
  316.            Two more long standing bugs fixed (ARC & PIC switches had
  317.            inverted sense).  Add fix for paths with "~" in, so will
  318.            align path correctly.  Add semi-intelligence so that won't
  319.            ask about downloading a file with the same suffix as the
  320.            last file that was confirmed.  Add the TERSE function.
  321. v0.53ß (10-12-98) - The DEPTH feature now works, added the PORT feature,
  322.            added the NOPAUSE feature.  Fixed long standing bug of NOASK
  323.            not being recognised.  Now removes text in URL after "?"s.
  324. v0.52ß ( 8-12-98) - Basically update documentation ready for it's first Aminet
  325.                    release, for when packaged along with HTTPResume.  Added an
  326.            untested DEPTH feature in the special v0.52aß.
  327. v0.51ß (??-??-98) - Internal speed-up (may be much faster downloading small pages)
  328.                   - minor fix of arguments given to HTTPResume
  329. v0.5ß  (??-??-98) - Initial release to a few people.  No bugs, honest =:)
  330.